<tr data-id="{{id}}" data-parent="{{parent.id}}">
    <td style="padding-left: {{multiply depth 20}}px;">
        <span class="toggle cursor-pointer" data-id="{{id}}">
            {{#if children.length}}
            <i class="bi bi-folder-minus"></i>
            {{/if}}
        </span>
        {{name}}
    </td>
    <td>
        <span class="status-toggle" data-id="{{id}}" data-status="{{status}}">
            {{#if status}}
            <i class="bi bi-check-circle-fill text-success"></i>
            {{else}}
            <i class="bi bi-x-circle-fill text-danger"></i>
            {{/if}}
        </span>
    </td>
    <td>
        <span class="sort-text" data-id="{{id}}">{{sort}}</span>
        <input type="number" class="form-control sort-input d-none" style="width:80px" data-id="{{id}}"
            value="{{sort}}">
    </td>
    <td>
        <a href="/admin/categories/{{id}}" class="btn btn-primary btn-sm">查看</a>
        <a href="/admin/categories/{{id}}/edit" class="btn btn-warning btn-sm">编辑</a>
        <button class="btn btn-danger btn-sm" onclick="deleteCategory({{id}})">删除</button>
    </td>
</tr>
{{#each children}}
{{> category-node this depth=(inc ../depth)}}
{{/each}}